/**
 * Copyright (C) 2017-2018 pinganfang, Inc. All Rights Reserved.
 */
package com.pingan.haofang.searchcloud.index.dto;

import java.util.List;
import java.util.Map;
import java.util.Set;

import com.pingan.haofang.searchcloud.api.IndexRowData;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author huhailiang937
 * @date 2017年5月10日下午2:58:30
 * @since 1.0.0
 */
@ApiModel(description = "SQL查询结果")
public class SqlResultDTO {

    @ApiModelProperty("查询到总记录数")
    private long totalFound;

    @ApiModelProperty("查询数据")
    private long time;

    @ApiModelProperty("当前返回录数")
    private long resultSize;

    @ApiModelProperty("数据集")
    private List<IndexRowData> result;

    @ApiModelProperty("数据集列名")
    private Set<String> resultColumns;

    @ApiModelProperty("列的属性")
    private List<ColumnModel> columnProperties;


    /**
     * @return the time
     */
    public long getTime() {
        return time;
    }

    /**
     * @param time the time to set
     */
    public void setTime(long time) {
        this.time = time;
    }

    /**
     * @return the totalFound
     */
    public long getTotalFound() {
        return totalFound;
    }

    /**
     * @param totalFound the totalFound to set
     */
    public void setTotalFound(long totalFound) {
        this.totalFound = totalFound;
    }

    /**
     * @return the result
     */
    public List<IndexRowData> getResult() {
        return result;
    }

    /**
     * @param result the result to set
     */
    public void setResult(List<IndexRowData> result) {
        if (null != result && result.size() != 0) {
            IndexRowData rowData = result.get(0);
            this.setResultColumns(rowData.keySet());
        }
        this.result = result;
    }

    /**
     * @return the resultSize
     */
    public long getResultSize() {
        return resultSize;
    }

    /**
     * @param resultSize the resultSize to set
     */
    public void setResultSize(long resultSize) {
        this.resultSize = resultSize;
    }

    /**
     * @return the resultColumns
     */
    public Set<String> getResultColumns() {
        return resultColumns;
    }

    /**
     * @param resultColumns the resultColumns to set
     */
    public void setResultColumns(Set<String> resultColumns) {
        this.resultColumns = resultColumns;
    }

    public List<ColumnModel> getColumnProperties() {
        return columnProperties;
    }

    public void setColumnProperties(List<ColumnModel> columnProperties) {
        this.columnProperties = columnProperties;
    }
}
